//
//  GYSystemMsgCell.m
//  GoodLuck
//
//  Created by apple on 2018/3/20.
//  Copyright © 2018年 yunjiazhineng. All rights reserved.
//

static NSString *systemMsgCellIdentifier = @"systemMsgCellIdentifier";

#import "GYSystemMsgCell.h"

@interface GYSystemMsgCell ()
@property (weak, nonatomic) IBOutlet UILabel *msgDetailsLable;
@property (weak, nonatomic) IBOutlet UILabel *msgTimeLable;
@property (weak, nonatomic) IBOutlet UILabel *msgTitleLable;

@end
@implementation GYSystemMsgCell

+ (instancetype)cellWithTableView:(UITableView *)tableView {
    GYSystemMsgCell *cell = [tableView dequeueReusableCellWithIdentifier:systemMsgCellIdentifier];
    if (cell == nil) {
        cell = [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class]) owner:nil options:nil] firstObject];
    }
    
    return cell;
}

- (void)setModel:(GYSystemMsg *)model {
    _model = model;
    
    self.msgDetailsLable.text = model.message_body;
    self.msgTimeLable.text = model.message_time;
    self.msgTitleLable.text = model.message_title;
}

- (CGFloat)height:(GYSystemMsg *)msg {
    self.model = msg;
    
    [self layoutIfNeeded];
    
    return CGRectGetMaxY(self.msgDetailsLable.frame)+20;
}
@end
